﻿using System.ServiceModel;
using System.ServiceModel.Web;
using System.Collections.Generic;
using Perseus.WCF.REST.Contract.Data;

namespace Perseus.WCF.REST.Contract.Service
{
    [ServiceContract]
    public interface IEmployeeService
    {
        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Xml,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "xml/employees")]
        List<Employee> GetAllEmpByXml();

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "json/employees")]
        List<Employee> GetAllEmpByJson();

        [OperationContract]
        [WebInvoke(Method = "PUT",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "employees/{emp_id}?firstName={firstName}&lastName={lastName}" 
                        + "&birthDate={birthDate}")]
        DbResponse UpdateEmployee(string emp_id, string firstName, string lastName, string birthDate);
    }
}
